{* Smarty - iDaren问题搜索页面 *}

{* 页面的头部 *}
{include file="header.tpl"}

<div id="main">


	<div id="mainbar">
	{include file="sub-header.tpl"}
		
		<div id="search-results">
			<div id="search-desc">
				<div id="result-status">找到约 {$content.search_results.total} 条结果（用时 {$content.search_results.time} 秒）</div>
			</div>
		</div>
		<div id="questions">

		{* 循环显示问题列表 *}
		{section name=q_ptr loop=$content.questions}

		{* 问题的具体的概括信息 *}
			<div id="question-summary-{$content.questions[q_ptr].id}" class="question-summary">

			{* 问题的投票按钮 *}
				<div class="statuscontainer">
					<div class="status voteup">
						<span>{$content.questions[q_ptr].up_votes_num}</span>
						<div>顶</div>
					</div>
					<div class="status votedown">
						<span>{$content.questions[q_ptr].down_votes_num}</span>
						<div>踩</div>
					</div>
					<div class="status answered">
						<span>{$content.questions[q_ptr].answers_num}</span>
						<div>回答</div>
					</div>
					<div class="status favorited">
						<span>{$content.questions[q_ptr].marks_num}</span>
						<div>关注</div>
					</div>
				</div>

			{* 问题的概括信息 *}
				<div class="summary">
				{* 标题 *}
					<h3>
						<a href="/dr-includes/dr-page-question-answer.php?qid={$content.questions[q_ptr].question_id}">{$content.questions[q_ptr].title}</a>
					</h3>
					<div class="excerpt">{$content.questions[q_ptr].content|truncate:237:"...":true}</div>
				{* 标签列表 *}
					<div class="tags-list">
						标签:{assign var="tags" value=$content.questions[q_ptr].tags}
						{section name=t_ptr loop=$tags}
							<a href="{$BASE_HOSTPATH}dr-includes/dr-page-question-list.php?tid={$tags[t_ptr].id}" title="查看tag相关问题">{$tags[t_ptr].title}</a>
						{/section}
					</div>
				{* 提问者的信息 *}
					<div class="question-owner">
						<div class="user-info">
							<div class="user-action-time" title="提问时间">
								{$content.questions[q_ptr].created_date}
							</div>
							<div class="user-gravatar32">
								<a href="/dr-admin/dr-page-userinfo.php?uid={$content.questions[q_ptr].user_id}" title="{$content.questions[q_ptr].user_username}"><img width="32" height="32" alt="" src="{$content.questions[q_ptr].user_avatar}" /></a>
							</div>
							<div class="user-details">
								<a href="/dr-admin/dr-page-userinfo.php?uid={$content.questions[q_ptr].user_id}" class="username" title="进入个人主页">{$content.questions[q_ptr].user_username}</a>
								<div class="reputation-score" title="积分">{$content.questions[q_ptr].user_points}</div>
							</div>
						</div>
					</div><!-- end question-owner -->
				</div><!-- end summary -->
			</div> <!-- end question-summary -->
		{/section}
		</div> <!-- end questions -->
	{* 分页链接 *}
	{assign var="pre" value=$question_page-1}
	{assign var="next" value=$question_page+1}
		<table align="right">
			<tr>
			{if $question_page gt 1}
				<td>
					<a href='#' onclick="change_page('{$pre}');return false;">上一页</a>
				</td>
			{/if}
			{section name=ptr loop=$pages}
				{if $pages[ptr].order eq "..."}
					<td>...</td>
					{else}
					<td>
						<a href='#' onclick="change_page('{$pages[ptr].order}');return false;">{$pages[ptr].order}</a>
					</td>
				{/if}
			{/section}
			{if $question_page lt $pages|@count}
				<td>
					<a href='#' onclick="change_page('{$next}');return false;">下一页</a>
				</td>
			{/if}
			</tr>
		</table>
	</div>
{include file="right.tpl"}
</div>

{* 页面的页脚 *}
{include file="footer.tpl"}